function bar(title_str, xAxisList, seriesList,type) {

    var legend = {
        floating: true,
        // align: 'right',
        // verticalAlign: 'top',
        // x: -10
        y:25
    }

    var chart = {
        // type: 'bar',
        type:type,
        // height: heightStr,
        // width: widthStr
    };
    var title = {
        text: title_str
    };
    var xAxis = {
        title: {
            text: null
        },
        categories: xAxisList,
        crosshair: true
    };
    var yAxis = {
        min: 0,
        title: {
            text: ""
        },
        labels: {
            overflow: 'justify'
        }
    };
    var barPlotOptions = {
        series: {
            stacking: 'normal'
        }
    };
    var columnPlotOptions = {
        column: {stacking: 'normal'}
    };
    var credits = {
        enabled: false
    };

    var series = seriesList;

    var json = {};
    json.chart = chart;
    json.title = title;
    json.xAxis = xAxis;
    json.yAxis = yAxis;
    json.series = series;
    if(type=="column"){
        json.plotOptions = columnPlotOptions;
    }
    if (type=="bar"){
        json.plotOptions = barPlotOptions;
    }
    json.credits = credits;
    json.legend = legend;
    return json
}